<template>
	<view class="item">
		<view class="item_content bg-white layout-margin-16">
			<view class="item-title">
				{{objInfo.title}}
			</view>
			<view class="item-info" v-for="(i,o) in objInfo.list" :key="o">
				<view>{{i.name}}</view>
				<view :class="i.type=='orange'?'orange-color':i.type=='black'?'black-color':''">{{i.value}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'item',
		data () {
			return {
				objInfo: {}
			}
		},
		props: {
			info: {
				type: Object,
				default: () => ({})
			}
		},
		computed: {

		},
		methods: {
		},
		mounted () {
			this.objInfo = {
				title: this.info.date,
				list: [
					{name: '收入', value: `+￥${this.info.pay_real}`, type: 'orange'},
					{name: '退款', value: `-￥${this.info.refund}`, type: 'black'},
					{name: '订单数', value: `${this.info.orders}笔`},
					{name: '交易人数', value: `${this.info.payers}人`},
				]
			}
			
		}
	}
</script>

<style lang="scss" scoped>
@import "@/assets/css/user.scss";
</style>